<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" th:src="@{/js/jquery-1.12.4.js}"></script>
</head>

<body>
<div class="place"> <span>位置：</span>
    <ul class="placeul">
        <li>营销管理</li>
        <li>订购单管理</li>
        <li>修改</li>
    </ul>
</div>
<div class="formbody">
    <div class="formtitle"><span>订购单信息</span></div>
    <ul class="forminfo">
        <li>
            <label>订单编号</label>
            <input name="orderid" type="text" th:value="${orders.orderid}" readonly="readonly" class="roinput" />
            <i>自动生成不能编辑</i>
        </li>
        <li>
            <label>客户姓名</label>
            <!--<select name="customid" class="dfinput">-->
                <!--<option value="0">请选择</option>-->
                <!--<option th:each="c :${customs}" th:selected="${c.customid==orders.customid}" th:value="${c.customid}"-->
                        <!--th:text="${c.customname}"></option>-->
            <!--</select>-->
            <input name="custom.customname" type="text" th:value="${orders.custom.customname}"  class="dfinput" />
            <i>不能为空</i>
        </li>
        <li>
            <label>订购时间</label>
            <input name="" type="text"  th:value="${#dates.format(orders.ordertime,'yyyy/MM/dd')}" readonly="readonly" class="roinput" />
            <i>不能编辑</i>
        </li>
        <li>
            <label>创建人</label>
            <input name="" type="text" th:value="${orders.operatorUser.uname}" readonly="readonly" class="roinput" />
            <i>不能编辑</i>
        </li>
        <li>
            <label>审核状态</label>
            <input type="text" th:value="${orders.status=='0'?'未审核':'审核未通过'}" readonly="readonly" class="roinput" />
            <input name="status" type="hidden" th:value="${orders.status}"/>
            <i>初始状态，不能编辑</i>
        </li>
        <li>
            <label>总金额</label>
            <input name="ordermoney" type="text" th:value="${orders.ordermoney}" readonly="readonly" class="roinput" />
            <i>自动运算，不能编辑</i>
        </li>
        <li>
            <input type="button" value="新增" class="smallbtn" />
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" value="删除" class="smallbtn" />
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" value="保存" class="smallbtn" />
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" value="返回" class="smallbtn" onclick="window.location.href='orderList.html'"/>
        </li>
    </ul>
    <table class="tablelist">
        <thead>
        <tr>
            <th>序号</th>
            <th>品牌</th>
            <th>类型</th>
            <th>型号</th>
            <th>数量</th>
            <th>单位</th>
            <th>单价</th>
            <th>金额</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="od,i : ${orderdetails}">
            <td th:text="${i.count}">1</td>
            <td>
                <input type="hidden" th:value="${od.product.types.cBrand.brandId}" />
                <select class="brandSelect" name="brandId">
                    <option value="0">请选择</option>
                    <option th:each="b:${brands}" th:selected="${b.brandId==od.product.types.cBrand.brandId}" th:value="${b.brandId}" th:text="${b.brandName}">请选择</option>
                </select>
            </td>
            <td>
                <input type="hidden" th:value="${od.product.types.typeId}" />
                <select class='typeSelect' name='typeId'>
                    <option value="0">请选择</option>
                    <option th:each="t :${types}" th:selected="${t.typeId==od.product.types.typeId}" th:if="${t.brandId==od.product.types.cBrand.brandId}" th:value="${t.brandId}" th:text="${t.typeName}"></option>
                </select>
            </td>
            <td>
                <input type="hidden"  th:value="${od.product.productId}" />
                <select  class='productSelect' name='productId'>
                    <option value="0">请选择</option>
                    <option th:each="p :${products}" th:if="${p.typeId==od.product.types.typeId}" th:selected="${p.productId==od.product.productId}" th:value="${p.productId}" th:text="${p.productModel}">请选择</option>
                </select>
            </td>
            <td><input type="text" name='purchaseNum' class='num' th:value="${od.purchaseNum}"/></td>
            <td>台</td>
            <td><input type="text" name='proprice' class='price' th:value="${od.proprice}"/></td>
            <td><input type="text" name='prototal' class='sum' style='border: 0px white solid' th:value="${od.prototal}"/></td>
        </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
